﻿@model Citi.GocAttributes.WebUI.Models.TypeRuleResultModel

<script type="text/javascript">
    $(function () {
        $("#Value").focus();

        $("#form").submit(function () {
            $('#otAttributesCreate').modal('toggle');
        });
    });
</script>

@using (Ajax.BeginForm("Form", "TypeRuleResult", new AjaxOptions { UpdateTargetId = "otAttributesList" }, new { id = "form" }))
{
    @Html.ValidationSummary(true)
    <fieldset>

        @if (Model != null && Model.Id != 0)
        {
            @Html.HiddenFor(model => model.Id)    
        }
            
        @Html.Display(Model.Type.GetDescription())
        @Html.HiddenFor(model => model.Type)

        <div class="editor-label">
            @Html.LabelFor(model => model.Value)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Value)
            @Html.ValidationMessageFor(model => model.Value)
        </div>

        <p>
            <input type="submit" value="Save" class="btn" />
        </p>
    </fieldset>
}
